onDownloadFileCompleted

open fun onDownloadFileCompleted(file: File)

Callback invoked when the DownloadFileTask2 (for downloading an image from a URL) completes.

If the download was successful (file.isDownloaded is true):

  • If the downloaded file is an SVG (based on MIME type "image/svg+xml"), it's loaded using loadSVG.
  • Otherwise, it's treated as a raster image. Any existing bitmap is recycled, and the new image is decoded (sampled if module dimensions are available) and set as the content of this ImageView.
If the download failed, a warning is logged, and no image is set or changed.

Parameters

file

The com.reveldigital.player.json.File object representing the downloaded image. The isDownloaded field indicates success, and getMediaFile provides access to the downloaded content.